from browser import window
from browser import document


queryParams = window.location.search
kv = {}

if queryParams:
    queryParams = queryParams[1:]
    pList = queryParams.split("&")

    for p in pList:
        info = p.split("=")
        k = info[0]
        v = info[1]

        kv[k] = v


if "page" in kv:

    if "groups" == kv["page"]:
        btn = document["groupManageBtn"]
        btn.click()

    elif "hosts" == kv["page"]:
        btn = document["hostsManageBtn"]
        btn.click()

    elif "users" == kv["page"]:
        btn = document["userManageBtn"]
        btn.click()